package com.adou.d16.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * read(bytes) 每次读到 多个字节
 */
public class ITest2 {
    public static void main(String[] args) throws Exception {
        InputStream is = new FileInputStream("d1-helloword-app\\src\\it02.txt");
        byte[] bytes = new byte[3];
        int len = is.read(bytes);

        // 读取3个字节
        String str = new String(bytes);
        System.out.println(str + " //- " + len);//abc

        int len2 = is.read(bytes);
        String str2 = new String(bytes);
        // c是生一次读到数据
        System.out.println(str2 + "  ++++++ " + len2);//dec 2


    }
}
